package com.wnxy.util;

import com.wnxy.service.ProductService;
import feign.hystrix.FallbackFactory;

/**
 * @Classname MyFallBackFactory
 * @Description :
 * @Date 2021/2/27 15:55
 * @Created by Yeheng
 */
public class MyFallBackFactory implements FallbackFactory<ProductService> {
    @Override
    public ProductService create(Throwable throwable) {
        return new ProductService() {

            @Override
            public ResultVO findOne(Integer pid) {
                return ResultVO.success(null);
            }

            @Override
            public ResultVO reduceStock(Integer pid, Integer num) {
                return null;
            }

            @Override
            public ResultVO findAll() {
                return null;
            }
        };
    }

}
